package com.snap.awesomeserial.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.snap.awesomeserial.ui.HomeActivity;

public class UpdateApkReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent != null && intent.getAction() != null &&
                intent.getAction().equals(Intent.ACTION_MY_PACKAGE_REPLACED)) {
            Intent intent2 = new Intent(context, HomeActivity.class);
            intent2.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(intent2);
        }
    }
}
